CC	= cc
LD	= cc
INCLUDE	= -I../include
CCFLAGS	= ${INCLUDE} -DLINKAGE= -O3
ARFLAGS = 	-rlcs

EXECUTABLES = 	edge\
		comp\

OBJS	= ../src/mask.o

CP      =       cp
RM      =       rm -f

EDGE_OBJS = edge.o

COMP_OBJS = comp.o

LDLIBS	= ${OBJS} -lm

# ---- Targets ---------------------------------------------

# Rules for building each executable

edge: ${EDGE_OBJS} ${OBJS}
	@ echo linking $@
	@ ${LD} -o $@ ${CCFLAGS} ${EDGE_OBJS} ${LDLIBS}

comp: ${COMP_OBJS} ${OBJS}
	@ echo linking $@
	@ ${LD} -o $@ ${CCFLAGS} ${COMP_OBJS} ${LDLIBS}

# Build and install the executables.

apps: ${EXECUTABLES}
	- ${CP} ${EXECUTABLES} ../bin

all: apps

# Remove all files generated or installed by make.  

clean:
	- rm -f ${EDGE_OBJS} ${COMP_OBJS}; rm -f ${EXECUTABLES}; 
	- cd ../bin/; rm -f ${EXECUTABLES}; 

# First clear out the default suffixes, then declare our own and
# define the rules.

.SUFFIXES:
.SUFFIXES: .o .c

# compile

.c.o:
	@ echo; echo compiling $<
	- ${CC} -c -g ${CCFLAGS} $<
